package sunsun.xiaoli.jiarebang.utils;

import android.text.Html;
import android.text.Spanned;

/**
 * @Author:Create by Mr.w
 * @Date:2018/11/28 16:27
 * @Description:
 */
public class HtmlTextUtil {
    static String USER_NICK = "#EF8200";

    public static Spanned getEnterLivingRoomHtml(String nickname) {
        return Html.fromHtml(String.format("欢迎<font color='" + USER_NICK + "'>%s</font>进入直播间", nickname));
    }

    public static Spanned getSystemTipsHtml(String systemMessgage) {
        return Html.fromHtml(String.format("<font color='#EBE51F'>系统消息：%s</font>", "提倡绿色直播，回复内容禁止涉及低俗"));
    }

    public static Spanned getChatMessgageHtml(String nick, String content) {
        return Html.fromHtml(String.format("<font color='" + USER_NICK + "'>%s:</font><font color='white'>%s</font>", nick, content));
    }

    public static Spanned getChatMessgageHtml(String role, String nick, String content) {
        return Html.fromHtml(String.format("<font color='red'>%s</font><font color='" + USER_NICK + "'>%s:</font><font color='white'>%s</font>", role, nick, content));
    }

    //被提出房间
    public static Spanned getKickOutHtml(String nick) {
        return Html.fromHtml(String.format("<font color='" + USER_NICK + "'>%s</font>被踢出房间禁言", nick));
    }

    //被禁言
    public static Spanned getForbidHtml(String nick) {
        return Html.fromHtml(String.format("<font color='" + USER_NICK + "'>%s</font>被禁言", nick));
    }

    //恢复禁言
    public static Spanned getResumeChatHtml(String nick) {
        return Html.fromHtml(String.format("<font color='" + USER_NICK + "'>%s</font>已经被取消禁言", nick));
    }

    //房间禁止聊天
    public static Spanned getNoChatHtml(String nick) {
        return Html.fromHtml(String.format("<font color='" + USER_NICK + "'></font>该房间禁止聊天", nick));
    }
}
